package com.asp.alumnisystem.adapter;

import com.asp.alumnisystem.base.BaseAdapter;
import com.asp.alumnisystem.base.IRefreshView;

/**
 * 基于BaseAdapter的adapter，主要适配CustomRecyclerView使用
 */
public abstract class AspBaseAdapter<T> extends BaseAdapter<T> {

    private IRefreshView refreshView;

    protected AspBaseAdapter(IRefreshView refreshView){
        this.refreshView = refreshView;
    }

    @Override
    public void dataChange() {
        super.dataChange();
        if (refreshView != null){
            if (getItemCount() == 0){
                refreshView.showEmptyLayout();
            }else{
                refreshView.showRefreshLayout();
            }
        }
    }
}

